﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _06.ReadAndSumValuesFromString
{
    class ReadAndSumValuesFromString
    {
        static void Main(string[] args)
        {
            string str = "43 68 9 23 318";
            Console.WriteLine(str);
            string[] numbers = str.Split(' ');
            int sum = 0;
            foreach (string number in numbers)
            {
                sum += int.Parse(number);
            }
            Console.WriteLine("Sum is:{0}", sum);
        }
    }
}
